home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Internet Tools 1995 April / Internet Tools.iso / news / transport / cnews / patches / CR.C < prev    next >
Encoding:
Text File  |  1994-11-27  |  27.6 KB  |  1,145 lines

  1. Newsgroups: news.software.b
  2. Subject: C News patch CR.C
  3.  
  4. This is the second part of a two-part patch, the first being CR.B, for
  5. the Cleanup Release of C News.  The distribution files
  6. on ftp.cs.toronto.edu and zoo.toronto.edu have been updated to match.
  7. See the README.changes diff below for what's been done.
  8.  
  9. start of patch CR.C
  10. (suggested archive name:  patchCR.C)
  11. apply with   patch -p0 <thisfile
  12.  
  13. Prereq: CR.B
  14. *** README.mastercopy    Sun Nov 27 20:36:32 1994
  15. --- README    Sun Nov 27 20:16:16 1994
  16. ***************
  17. *** 1,4 ****
  18. ! Cleanup Release of C News, with patch CR.B (which needs .C).    Nov 1994
  19.   
  20.   The current C News distribution can be retrieved by anonymous FTP from
  21.   ftp.cs.toronto.edu (file pub/c-news/c-news.tar.Z) or ftp.zoo.toronto.edu
  22. --- 1,4 ----
  23. ! Cleanup Release of C News, with patch CR.C.            Nov 1994
  24.   
  25.   The current C News distribution can be retrieved by anonymous FTP from
  26.   ftp.cs.toronto.edu (file pub/c-news/c-news.tar.Z) or ftp.zoo.toronto.edu
  27.  
  28.  
  29.  
  30. *** README.changes.mastercopy    Sun Nov 27 20:36:33 1994
  31. --- README.changes    Sun Nov 27 20:35:32 1994
  32. ***************
  33. *** 1,3 ****
  34. --- 1,20 ----
  35. + High points of patch CR.C:
  36. + This is the second part of a two-part patch, the first being CR.B.  Install
  37. + both parts, this one second.  In this part...  A nasty bug in newsgroup
  38. + removal (which could wipe out a number of files in NEWSCTL) has been fixed.
  39. + There is a new command, checkactive, which does a fairly rigorous check of
  40. + the contents of the active file; several commands which modify the active
  41. + file now use checkactive to check their new version before installing it.
  42. + Mergeactive now adds directories for the new newsgroups.  The badexpiry
  43. + command, which looks for newsgroups with many articles with long expiry
  44. + dates, has been improved and is now documented.  The newsdb(5) manpage
  45. + now warns reader implementors about non-atomic updates.  Postnews retains
  46. + the user's PATH for use within the editor.  dostatfs.c has been made a bit
  47. + more portable (I hope), or at least easier to fix when it does break --
  48. + the statfs() system call is not very portable, it turns out.  queuelen.old
  49. + has been renamed queuelen.vo for internal reasons.  Plus the usual minor
  50. + cleanups and fixes.
  51.   High points of patch CR.B:
  52.   This is the first part of a two-part patch, the second being CR.C.  Install
  53.   both parts, this one first.  In this part...  The viauux -g option now accepts
  54.  
  55.  
  56.  
  57. *** conf/versionname.mastercopy    Sun Nov 27 20:36:34 1994
  58. --- conf/versionname    Sun Nov 27 20:16:25 1994
  59. ***************
  60. *** 1 ****
  61. ! Cleanup Release, with patch CR.B but not .C
  62. --- 1 ----
  63. ! Cleanup Release, with patch CR.C
  64.  
  65.  
  66.  
  67. *** maint/mergeactive.mastercopy    Sun Nov 27 20:36:34 1994
  68. --- maint/mergeactive    Thu Nov 10 00:05:35 1994
  69. ***************
  70. *** 34,59 ****
  71.   cat $* >$tmp
  72.   
  73.   # do some checking
  74. ! awk 'NF != 4 || $1 ~ /\// || $4 !~ /^([ynmx]|=[^\/]+)$/' $tmp >$err
  75.   if test -s $err
  76.   then
  77. !     echo "$0: `wc -l <$err` bad lines in input" >&2
  78.       exit
  79.   fi
  80. - awk '{ print $1 }' $tmp | sort | uniq -d >$err
  81. - if test -s $err
  82. - then
  83. -     echo "$0: `wc -l <$err` duplicate newsgroups in input" >&2
  84. -     exit
  85. - fi
  86. - awk '$4 ~ /^=/ { print substr($4, 2) }' $tmp | sort -u >$tmpb
  87. - awk '{ print $1 }' active $tmp | sort -u | comm -13 - $tmpb >$err
  88. - if test -s $err
  89. - then
  90. -     echo "$0: `wc -l <$err` groups are =ed to nonexistent groups" >&2
  91. -     exit
  92. - fi
  93. - awk '{ print $1, $4 }' $tmp | sort >$tmpb
  94.   
  95.   # now we need to make sure things don't change underfoot...
  96.   lock LOCK $$ 10 || exit
  97. --- 34,46 ----
  98.   cat $* >$tmp
  99.   
  100.   # do some checking
  101. ! checkactive -q $tmp >$err 2>&1
  102.   if test -s $err
  103.   then
  104. !     echo "$0: problems in input:" >&2
  105. !     cat $err >&2
  106.       exit
  107.   fi
  108.   
  109.   # now we need to make sure things don't change underfoot...
  110.   lock LOCK $$ 10 || exit
  111. ***************
  112. *** 60,73 ****
  113.   locks=LOCK
  114.   
  115.   # let's be paranoid...
  116. ! awk 'NF != 4' active >$err
  117.   if test -s $err
  118.   then
  119. !     echo "$0: $NEWSCTL/active contains bad lines!" >&2
  120.       exit
  121.   fi
  122.   
  123.   # pick out the new ones
  124.   sort active | join -a2 - $tmpb | awk 'NF == 2' >$tmp
  125.   
  126.   # and away we go...
  127. --- 47,62 ----
  128.   locks=LOCK
  129.   
  130.   # let's be paranoid...
  131. ! checkactive -q active >$err 2>&1
  132.   if test -s $err
  133.   then
  134. !     echo "$0: problems in $NEWSCTL/active:" >&2
  135. !     cat $err >&2
  136.       exit
  137.   fi
  138.   
  139.   # pick out the new ones
  140. + awk '{ print $1, $4 }' $tmp | sort >$tmpb
  141.   sort active | join -a2 - $tmpb | awk 'NF == 2' >$tmp
  142.   
  143.   # and away we go...
  144. ***************
  145. *** 89,94 ****
  146. --- 78,86 ----
  147.   mv active active.old || exit
  148.   mv active.tmp active || exit
  149.   mv active.times active.times.o && mv actimes.tmp active.times
  150. + # and add any necessary directories
  151. + adddirs
  152.   
  153.   # looks like it worked
  154.   status=0
  155.  
  156.  
  157.  
  158. *** maint/badexpiry.mastercopy    Sun Nov 27 20:36:35 1994
  159. --- maint/badexpiry    Tue Oct 18 21:52:11 1994
  160. ***************
  161. *** 1,7 ****
  162.   #! /bin/sh
  163. ! # Reports groups with more than 25 articles
  164. ! # or 250KB of articles with expiry dates more than 10 days after their
  165. ! # arrival dates.
  166.   # =()<. ${NEWSCONFIG-@<NEWSCONFIG>@}>()=
  167.   . ${NEWSCONFIG-/etc/news/bin/config}
  168.   
  169. --- 1,7 ----
  170.   #! /bin/sh
  171. ! # Reports groups with more than $1 articles, >90% of all articles, or
  172. ! # or >$2KB of articles with expiry dates more than 10 days after their
  173. ! # arrival dates.  Defaults 15 and 500.
  174.   # =()<. ${NEWSCONFIG-@<NEWSCONFIG>@}>()=
  175.   . ${NEWSCONFIG-/etc/news/bin/config}
  176.   
  177. ***************
  178. *** 8,22 ****
  179.   PATH=$NEWSCTL/bin:$NEWSBIN:$NEWSPATH ; export PATH
  180.   umask $NEWSUMASK
  181.   
  182.   cd $NEWSARTS
  183. ! egrep '[0-9]    ' $NEWSCTL/history |
  184. !     awk -F'    ' '{
  185. !             n = split($2, f, "~")
  186. !             if (f[2] != "-" && f[2]-f[1] > 864000) {
  187. !                 n = split($3, f, " ")
  188. !                 for (i = 1; i <= n; i++)
  189. !                     print f[i]
  190. !             }
  191.       }' | tr . / | xargs $NEWSBIN/sizeof -i | sed 's;/[^/]* ; ;' |
  192.       ( sort ; echo dummy ) |
  193.       awk '{
  194. --- 8,28 ----
  195.   PATH=$NEWSCTL/bin:$NEWSBIN:$NEWSPATH ; export PATH
  196.   umask $NEWSUMASK
  197.   
  198. + case "$#" in
  199. + 0)    minarts=15 ; minsize=500    ;;
  200. + 2)    minarts=$1 ; minsize=$2        ;;
  201. + *)    echo "Usage: $0 [minarts minsize]" >&2 ; exit 2    ;;
  202. + esac
  203.   cd $NEWSARTS
  204. ! egrep -v '~-' $NEWSCTL/history |
  205. !     awk -F'    ' 'NF > 2 {
  206. !         n = split($2, f, "~")
  207. !         if (f[2] != "-" && f[2]-f[1] > 864000) {
  208. !             n = split($3, f, " ")
  209. !             for (i = 1; i <= n; i++)
  210. !                 print f[i]
  211. !         }
  212.       }' | tr . / | xargs $NEWSBIN/sizeof -i | sed 's;/[^/]* ; ;' |
  213.       ( sort ; echo dummy ) |
  214.       awk '{
  215. ***************
  216. *** 29,32 ****
  217.           }
  218.           n++
  219.           size += $2
  220. !     }' | tr / . | awk '$2 > 25 || $3 > 250000'
  221. --- 35,56 ----
  222.           }
  223.           n++
  224.           size += $2
  225. !     }' |
  226. !     while read group narts size
  227. !     do
  228. !         npresent=`ls -f $group | egrep '^[0-9]+$' | wc -l`
  229. !         echo $group $narts $npresent $size
  230. !     done | tr / . |
  231. !     awk '    { bad = "" }
  232. !         $2 > '$minarts' {
  233. !             bad = bad ", " $2 " articles"
  234. !         }
  235. !         $2 > 0.9*$3 {
  236. !             bad = bad ", " $2 " out of " $3 " articles"
  237. !         }
  238. !         $4 > '$minsize'*1024 {
  239. !             bad = bad ", " int(($4+512)/1024) "KB"
  240. !         }
  241. !         bad != "" {
  242. !             print $1, "has", substr(bad, 3), "on long expiry"
  243. !         }'
  244.  
  245.  
  246.  
  247. *** maint/newsdaily.mastercopy    Sun Nov 27 20:36:35 1994
  248. --- maint/newsdaily    Sun Nov 27 17:09:47 1994
  249. ***************
  250. *** 86,91 ****
  251. --- 86,102 ----
  252.       ) >>$gripes
  253.   fi
  254.   
  255. + # do a quick check of the active file
  256. + checkactive -q >$tmp
  257. + if test -s $tmp
  258. + then
  259. +     (
  260. +         echo 'checkactive reports problems in active file:'
  261. +         cat $tmp
  262. +         echo
  263. +     ) >>$gripes
  264. + fi
  265.   # sweep log file, once, for suspect lines
  266.   egrep '`
  267.   ancient
  268. ***************
  269. *** 158,167 ****
  270. --- 169,183 ----
  271.   
  272.   # and do other daily chores
  273.   $NEWSBIN/relay/dodelayed
  274.   if test -s dirs.tbd
  275.   then
  276.       while read dir
  277.       do
  278. +         if test ! -d $NEWSARTS/$dir
  279. +         then
  280. +             continue        # NOTE CONTINUE
  281. +         fi
  282.           cd $NEWSARTS/$dir
  283.           if test " `ls | egrep '^[0-9]+$' | wc -l`" -gt 0
  284.           then
  285. ***************
  286. *** 186,190 ****
  287. --- 202,207 ----
  288.               done
  289.           fi
  290.       done <dirs.tbd >dirs.ttd
  291. +     cd $NEWSCTL
  292.       mv dirs.ttd dirs.tbd
  293.   fi
  294.  
  295.  
  296.  
  297. *** maint/checkactive.mastercopy    Sun Nov 27 20:36:36 1994
  298. --- maint/checkactive    Mon Nov 14 16:57:13 1994
  299. ***************
  300. *** 0 ****
  301. --- 1,106 ----
  302. + #! /bin/sh
  303. + # checkactive - check an active file for worrisome signs
  304. + # checkactive file
  305. + # =()<. ${NEWSCONFIG-@<NEWSCONFIG>@}>()=
  306. + . ${NEWSCONFIG-/etc/news/bin/config}
  307. + PATH=$NEWSCTL/bin:$NEWSBIN:$NEWSPATH ; export PATH
  308. + umask $NEWSUMASK
  309. + quick=n
  310. + for dummy
  311. + do
  312. +     case "$1" in
  313. +     -q)    quick=y        ;;
  314. +     --)    shift ; break    ;;
  315. +     -*)    echo "$0: unknown option \`$1'" >&2 ; exit 2    ;;
  316. +     *)    break        ;;
  317. +     esac
  318. +     shift
  319. + done
  320. + case $# in
  321. + 0)    file=$NEWSCTL/active    ;;
  322. + 1)    file=$1            ;;
  323. + *)    echo "Usage: $0 file" >&2 ; exit 2    ;;
  324. + esac
  325. + tmp=/tmp/ca$$
  326. + tmpb=/tmp/cb$$
  327. + status=1
  328. + trap 'rm -f $tmp $tmpb ; trap 0 ; exit $status' 0 1 2 15
  329. + if test ! -s $file
  330. + then
  331. +     echo "input is empty"
  332. +     exit
  333. + fi
  334. + awk 'BEGIN { status = 0 ; q = "\"" }
  335. + { where = "line " NR ":" }
  336. + NF != 4 { print where, "has", NF, "not 4 fields" ; status = 1 }
  337. + $1 !~ /^[a-z][a-z0-9+_-]*(\.([a-z0-9+_-]+|=\?([a-zA-Z0-9=.?+_-]|\/)*\?=))*$/ {
  338. +     # not fully rigorous, but a good first cut
  339. +     print where, "newsgroup name", q $1 q, "invalid" ; status = 1
  340. + }
  341. + $2 !~ /^[0-9]+$/ { print where, q $2 q, "is non-numeric" ; status = 1 }
  342. + $3 !~ /^[0-9]+$/ { print where, q $3 q, "is non-numeric" ; status = 1 }
  343. + $4 !~ /^([ynmx]|=.*)$/ {
  344. +     print where, "field 4 (" q $4 q ") invalid" ; status = 1
  345. + }
  346. + 0+$3 < 1 { print where, "field 3 (" q $3 q ") zero or negative" ; status = 1 }
  347. + 1+$2 < 0+$3 { print where, q $2 q, "<", q $3 q ; status = 1 }
  348. + END { exit status }' $file || exit
  349. + awk '{print $1}' $file | sort | uniq -d >$tmp
  350. + if test -s $tmp
  351. + then
  352. +     echo `wc -l <$tmp` "duplicate newsgroup name(s):"
  353. +     cat $tmp
  354. +     exit
  355. + fi
  356. + awk '$4 ~ /^=/ { print substr($4, 2) }' $file | sort -u >$tmp
  357. + awk '{ print $1 }' $file | sort -u | comm -13 - $tmp >$tmpb
  358. + if test -s $tmpb
  359. + then
  360. +     echo `wc -l <$tmpb` "newsgroup(s) are =ed to nonexistent groups:"
  361. +     cat $tmpb
  362. +     exit
  363. + fi
  364. + me="`newshostname`"
  365. + gngppat=`awk -f $NEWSBIN/canonsys.awk $NEWSCTL/sys |
  366. +     egrep "^($me|ME)[:/]" |
  367. +     awk -F: '
  368. + {
  369. +     fields = split($2, field2, "/")        # split ngs/dists
  370. +     nngs = split(field2[1], ngs, ",")    # split ng,ng,ng
  371. +     for (i = 1; i < nngs; i++)        # print field2[1] robustly
  372. +         printf "%s,", ngs[i]
  373. +     printf "%s\n", ngs[nngs]
  374. +     exit
  375. + }' `
  376. + awk '$1 !~ /^(control|junk)$/ { print $1 }' $file | gngp -a -v "$gngppat" >$tmp
  377. + if test -s $tmp
  378. + then
  379. +     echo `wc -l <$tmp` "newsgroup(s) are disallowed by ME line of sys file:"
  380. +     cat $tmp
  381. +     exit
  382. + fi
  383. + case "$quick" in
  384. + y)    status=0 ; exit    ;;
  385. + esac
  386. + # this is pretty slow
  387. + while read newsgroup rest
  388. + do
  389. +     echo "$newsgroup" | awk -f $NEWSBIN/namecheck.awk
  390. + done <$file | tee $tmp
  391. + if test -s $tmp
  392. + then
  393. +     exit
  394. + fi
  395. + status=0        # and the trap does the actual exit
  396.  
  397.  
  398.  
  399. *** maint/makefile.mastercopy    Sun Nov 27 20:36:36 1994
  400. --- maint/makefile    Mon Nov 14 16:58:27 1994
  401. ***************
  402. *** 4,10 ****
  403.   BINS=histinfo
  404.   NORMAL=$(BINS) newsdaily newswatch newsboot addgroup delgroup adddirs \
  405.       act.to.times histfrom newsfrom addmissing newshist badexpiry \
  406. !     newsflag mkhistory locknews histdups logroll mergeactive
  407.   CUSTOM=spaceshort
  408.   UI=cnewsdo
  409.   DPROGS=$(NORMAL) $(CUSTOM)
  410. --- 4,11 ----
  411.   BINS=histinfo
  412.   NORMAL=$(BINS) newsdaily newswatch newsboot addgroup delgroup adddirs \
  413.       act.to.times histfrom newsfrom addmissing newshist badexpiry \
  414. !     newsflag mkhistory locknews histdups logroll mergeactive \
  415. !     checkactive
  416.   CUSTOM=spaceshort
  417.   UI=cnewsdo
  418.   DPROGS=$(NORMAL) $(CUSTOM)
  419. ***************
  420. *** 29,34 ****
  421. --- 30,36 ----
  422.   cmp:    $(ALL)
  423.       @$(IN) $(DEST) $(DPROGS)
  424.       @$(IN) $(UIBIN) $(UI)
  425. +     $(DEST)/checkactive -q
  426.   
  427.   $(BINS):    $(LIB)
  428.   
  429. ***************
  430. *** 39,56 ****
  431.   FIXMIDFIELD='s/    [1-9][0-9]*~/    1~/'
  432.   
  433.   ../util/dbz:
  434. !     ( cd ../util ; $(MAKE) dbz )
  435.   
  436. ! rsetup:    $(PROGS) ../util/dbz
  437.       $(MX) $(PROGS)
  438.       mkdir bin maint
  439.       cp histinfo histdups maint
  440. !     cp ../util/dbz bin
  441.       echo 'exit 0' >bin/lock
  442.       echo 'exit 0' >bin/unlock
  443.       echo 'echo here' >bin/newshostname
  444.       echo 'echo 0' >bin/now
  445.       $(MX) maint/* bin/*
  446.       mkdir arts arts/foo arts/bar arts/bar/ugh arts/urp
  447.       mkdir arts/bletch arts/lost+found
  448.       echo nevermore >arts/lost+found/1
  449. --- 41,62 ----
  450.   FIXMIDFIELD='s/    [1-9][0-9]*~/    1~/'
  451.   
  452.   ../util/dbz:
  453. !     cd ../util ; $(MAKE) dbz
  454.   
  455. ! ../util/gngp:
  456. !     cd ../util ; $(MAKE) gngp
  457. ! rsetup:    $(PROGS) ../util/dbz ../util/gngp ../util/namecheck.awk ../util/canonsys.awk
  458.       $(MX) $(PROGS)
  459.       mkdir bin maint
  460.       cp histinfo histdups maint
  461. !     cp ../util/dbz ../util/gngp bin
  462.       echo 'exit 0' >bin/lock
  463.       echo 'exit 0' >bin/unlock
  464.       echo 'echo here' >bin/newshostname
  465.       echo 'echo 0' >bin/now
  466.       $(MX) maint/* bin/*
  467. +     cp ../util/namecheck.awk ../util/canonsys.awk .
  468.       mkdir arts arts/foo arts/bar arts/bar/ugh arts/urp
  469.       mkdir arts/bletch arts/lost+found
  470.       echo nevermore >arts/lost+found/1
  471. ***************
  472. *** 78,83 ****
  473. --- 84,90 ----
  474.       echo '<bar.ugh/13@trash>    0~0    bar.ugh/13' >>history.gbase
  475.       echo 'Message-ID: illegal' >arts/bar/ugh/13
  476.       sed $(FIXMIDFIELD) history.gbase | sort >history.good
  477. +     echo 'here/there:foo,bar,bletch/nonsense' >sys
  478.   
  479.   r:    $(PROGS) rclean rsetup
  480.       : "mkhistory"
  481. ***************
  482. *** 114,130 ****
  483.       cmp history.good history.fixed || diff history.good history.fixed
  484.       test ! -s addm.out ;
  485.       test ! -s addm.diag ;
  486. !     : give mergeactive a try
  487.       echo "foo 77 01 m" >active
  488.       echo "bar 99 77 y" >>active
  489.       echo "foo 0 nobody" >active.times
  490.       echo "bar 0 nobody" >>active.times
  491.       echo "foo 22 21 m" >active.new
  492.       echo "bletch 777 002 =foo" >>active.new
  493. !     cp active active.good
  494. !     echo "bletch 0000000000 00001 =foo" >>active.good
  495. !     cp active.times actimes.good
  496. !     echo "bletch 0 regression@here" >>actimes.good
  497.       $(HERE) ./mergeactive active.new >ma.out 2>ma.diag
  498.       test ! -s ma.out ;
  499.       test ! -s ma.diag ;
  500. --- 121,143 ----
  501.       cmp history.good history.fixed || diff history.good history.fixed
  502.       test ! -s addm.out ;
  503.       test ! -s addm.diag ;
  504. !     : quick verification that checkactive at least runs, not a good test...
  505.       echo "foo 77 01 m" >active
  506.       echo "bar 99 77 y" >>active
  507. +     echo "bletch 0000000000 00001 =foo" >>active
  508. +     $(HERE) ./checkactive >ca.out 2>ca.diag
  509. +     test ! -s ca.out ;
  510. +     test ! -s ca.diag ;
  511. +     : give mergeactive a try
  512.       echo "foo 0 nobody" >active.times
  513.       echo "bar 0 nobody" >>active.times
  514. +     echo "bletch 0 regression@here" >>active.times
  515.       echo "foo 22 21 m" >active.new
  516.       echo "bletch 777 002 =foo" >>active.new
  517. !     mv active active.good
  518. !     egrep -v bletch active.good >active
  519. !     mv active.times actimes.good
  520. !     egrep -v bletch actimes.good >active.times
  521.       $(HERE) ./mergeactive active.new >ma.out 2>ma.diag
  522.       test ! -s ma.out ;
  523.       test ! -s ma.diag ;
  524. ***************
  525. *** 135,140 ****
  526. --- 148,154 ----
  527.   rclean:
  528.       rm -f history history.pag history.dir active active.* active.times*
  529.       rm -f history.n* history.* *.out *.diag *.good *.fixed actimes.*
  530. +     rm -f namecheck.awk canonsys.awk sys
  531.       rm -rf arts maint bin
  532.   
  533.   clean:    rclean
  534.  
  535.  
  536.  
  537. *** man/expire.8cn.mastercopy    Sun Nov 27 20:36:37 1994
  538. --- man/expire.8cn    Wed Oct 19 00:15:25 1994
  539. ***************
  540. *** 4,10 ****
  541.   .ds b /usr/libexec/news
  542.   .\" =()<.ds c @<NEWSCTL>@>()=
  543.   .ds c /etc/news
  544. ! .TH EXPIRE 8CN "3 Oct 1994"
  545.   .BY "C News"
  546.   .SH NAME
  547.   expire, doexpire, expireiflow \- expire old news
  548. --- 4,10 ----
  549.   .ds b /usr/libexec/news
  550.   .\" =()<.ds c @<NEWSCTL>@>()=
  551.   .ds c /etc/news
  552. ! .TH EXPIRE 8CN "19 Oct 1994"
  553.   .BY "C News"
  554.   .SH NAME
  555.   expire, doexpire, expireiflow \- expire old news
  556. ***************
  557. *** 364,370 ****
  558.   \*c/history.o    history file as of last expiry
  559.   \*c/history.n*    new history file and \fIdbm\fR files abuilding
  560.   \*c/LOCKexpire    \fIdoexpire\fR's lock file
  561. - \*b/expire/*    various auxiliaries
  562.   .SH SEE ALSO
  563.   inews(1CN),
  564.   dbm(3),
  565. --- 364,369 ----
  566.  
  567.  
  568.  
  569. *** man/newsdb.5.mastercopy    Sun Nov 27 20:36:37 1994
  570. --- man/newsdb.5    Fri Nov 18 11:12:01 1994
  571. ***************
  572. *** 26,32 ****
  573.   .fi
  574.   .LP
  575.   ..
  576. ! .TH NEWSDB 5 "9 Sept 1994"
  577.   .BY "C News"
  578.   .SH NAME
  579.   newsdb \- USENET network news database: article tree, history, active, active.times
  580. --- 26,32 ----
  581.   .fi
  582.   .LP
  583.   ..
  584. ! .TH NEWSDB 5 "18 Nov 1994"
  585.   .BY "C News"
  586.   .SH NAME
  587.   newsdb \- USENET network news database: article tree, history, active, active.times
  588. ***************
  589. *** 157,162 ****
  590. --- 157,169 ----
  591.   .B \*c/history.dir
  592.   and
  593.   .BR \*c/history.pag .
  594. + .PP
  595. + Also usually present now are
  596. + .I overview
  597. + files, one per newsgroup;
  598. + see
  599. + .IR newsoverview (5)
  600. + for more detail on them.
  601.   .SH EXAMPLES
  602.   A trivial
  603.   .I active
  604. ***************
  605. *** 206,208 ****
  606. --- 213,226 ----
  607.   invented
  608.   by Mark Moraes and Geoff Collyer
  609.   as part of the C News project.
  610. + .SH BUGS
  611. + Reader implementors are warned that the
  612. + various files mentioned here\(emthe
  613. + .I active
  614. + file,
  615. + the
  616. + .I history
  617. + file,
  618. + the article tree itself,
  619. + and the overview files\(emin general are not updated perfectly simultaneously.
  620. + Nor are they necessarily updated in a predictable order.
  621.  
  622.  
  623.  
  624. *** man/badexpiry.8cn.mastercopy    Sun Nov 27 20:36:38 1994
  625. --- man/badexpiry.8cn    Tue Oct 18 21:55:30 1994
  626. ***************
  627. *** 0 ****
  628. --- 1,41 ----
  629. + .\" =()<.ds a @<NEWSARTS>@>()=
  630. + .ds a /var/news
  631. + .\" =()<.ds b @<NEWSBIN>@>()=
  632. + .ds b /usr/libexec/news
  633. + .\" =()<.ds c @<NEWSCTL>@>()=
  634. + .ds c /etc/news
  635. + .TH BADEXPIRY 8CN "18 Oct 1994"
  636. + .BY "C News"
  637. + .SH NAME
  638. + badexpiry \- find newsgroups with odd use of explicit expiry dates
  639. + .SH SYNOPSIS
  640. + .B badexpiry
  641. + [ mincount minsize ]
  642. + .SH DESCRIPTION
  643. + .I Badexpiry
  644. + reports (on standard output) newsgroups
  645. + with suspicious patterns of use of explicit
  646. + expiry dates in articles.
  647. + Specifically, it reports groups with more than
  648. + .I mincount
  649. + (default 15) articles,
  650. + more than 90% of all articles,
  651. + or more than
  652. + .I minsize
  653. + (default 500) KB of articles having explicit expiry dates
  654. + more than 10 days after their arrival dates.
  655. + .PP
  656. + Such reports are not necessarily indicative of abuses\(emfor example,
  657. + .I news.announce.newusers
  658. + legitimately has most or all of its articles on long expiry\(embut
  659. + investigation may be in order.
  660. + .SH FILES
  661. + \*c/history
  662. + .br
  663. + \*a/*/*/...
  664. + .SH SEE ALSO
  665. + news(5), newsdb(5)
  666. + .SH HISTORY
  667. + Written for C News by Henry Spencer.
  668. + .SH BUGS
  669. + The percentage and age thresholds ought to be settable.
  670.  
  671.  
  672.  
  673. *** man/checkactive.8.mastercopy    Sun Nov 27 20:36:38 1994
  674. --- man/checkactive.8    Mon Nov 14 17:01:41 1994
  675. ***************
  676. *** 0 ****
  677. --- 1,43 ----
  678. + .\" =()<.ds a @<NEWSARTS>@>()=
  679. + .ds a /var/news
  680. + .\" =()<.ds b @<NEWSBIN>@>()=
  681. + .ds b /usr/libexec/news
  682. + .\" =()<.ds c @<NEWSCTL>@>()=
  683. + .ds c /etc/news
  684. + .TH CHECKACTIVE 8CN "9 Nov 1994"
  685. + .BY "C News"
  686. + .SH NAME
  687. + checkactive \- check format of news active file
  688. + .SH SYNOPSIS
  689. + .B checkactive
  690. + [
  691. + .B \-q
  692. + ] [ file ]
  693. + .SH DESCRIPTION
  694. + .I Checkactive
  695. + checks the format of news's
  696. + .I active
  697. + file
  698. + (or the named
  699. + .IR file ,
  700. + if specified),
  701. + and also checks the file for consistency with the
  702. + .I sys
  703. + file.
  704. + Complaints, if any, are produced on standard output.
  705. + .PP
  706. + The
  707. + .B \-q
  708. + (quick) option suppresses one test,
  709. + precise checking of the format of newsgroup names,
  710. + which is relatively slow for a large
  711. + .I active
  712. + file.
  713. + .SH SEE ALSO
  714. + newsdb(5)
  715. + .SH HISTORY
  716. + Written at U of Toronto by Henry Spencer.
  717. + .SH BUGS
  718. + There's no good reason why name-format checking
  719. + .I has
  720. + to be so slow.
  721.  
  722.  
  723.  
  724. *** nov/expovguts.c.mastercopy    Sun Nov 27 20:36:39 1994
  725. --- nov/expovguts.c    Mon Oct 31 14:07:21 1994
  726. ***************
  727. *** 59,69 ****
  728.       }
  729.   
  730.       start = atol(argv[optind+1]);
  731. !     stop = atol(argv[optind]) + 100;    /* arbitrary slop */
  732. !     if (start >= stop || start == 0) {
  733. !         fprintf(stderr, "%s: min is 0 or exceeds max\n", progname);
  734.           exit(2);
  735.       }
  736.       if (debug)
  737.           printf("start %ld, stop %ld\n", start, stop);
  738.   
  739. --- 59,71 ----
  740.       }
  741.   
  742.       start = atol(argv[optind+1]);
  743. !     stop = atol(argv[optind]);        /* tentatively */
  744. !     if (start > stop+1 || start == 0) {
  745. !         fprintf(stderr, "%s: min (%s) is 0 or exceeds max (%s) + 1\n",
  746. !                 progname, argv[optind+1], argv[optind]);
  747.           exit(2);
  748.       }
  749. +     stop += 100;                /* a bit of headroom */
  750.       if (debug)
  751.           printf("start %ld, stop %ld\n", start, stop);
  752.   
  753.  
  754.  
  755.  
  756. *** readnews/postnews.mastercopy    Sun Nov 27 20:36:39 1994
  757. --- readnews/postnews    Wed Nov  2 00:16:59 1994
  758. ***************
  759. *** 4,10 ****
  760.   # =()<. ${NEWSCONFIG-@<NEWSCONFIG>@}>()=
  761.   . ${NEWSCONFIG-/etc/news/bin/config}
  762.   
  763. ! PATH=$NEWSCTL/bin:$NEWSBIN/inject:$NEWSBIN:$NEWSPATH    # but do not export it
  764.   umask 077                # private
  765.   
  766.   tmp=/tmp/pn$$
  767. --- 4,13 ----
  768.   # =()<. ${NEWSCONFIG-@<NEWSCONFIG>@}>()=
  769.   . ${NEWSCONFIG-/etc/news/bin/config}
  770.   
  771. ! oldpath="$PATH"
  772. ! newpath=$NEWSCTL/bin:$NEWSBIN:$NEWSPATH
  773. ! PATH=$newpath
  774. ! export PATH
  775.   umask 077                # private
  776.   
  777.   tmp=/tmp/pn$$
  778. ***************
  779. *** 82,88 ****
  780. --- 85,93 ----
  781.   echo REPLACE THIS LINE WITH YOUR TEXT >>$tmp
  782.   
  783.   trap : 2
  784. + PATH="$oldpath"
  785.   $edit $tmp
  786. + PATH=$newpath
  787.   trap "$term" 2
  788.   
  789.   while egrep '^(DELETE|REPLACE) THIS LINE' $tmp >/dev/null
  790. ***************
  791. *** 99,107 ****
  792.   
  793.       echo 'Editing again...  Please check it over carefully.'
  794.       trap : 2
  795.       $edit $tmp
  796.       trap "$term" 2
  797.   done
  798.   
  799.   echo 'Posting...'
  800. ! inews -h <$tmp
  801. --- 104,114 ----
  802.   
  803.       echo 'Editing again...  Please check it over carefully.'
  804.       trap : 2
  805. +     PATH="$oldpath"
  806.       $edit $tmp
  807. +     PATH=$newpath
  808.       trap "$term" 2
  809.   done
  810.   
  811.   echo 'Posting...'
  812. ! $NEWSBIN/inject/inews -h <$tmp
  813.  
  814.  
  815.  
  816. *** readnews/makefile.mastercopy    Sun Nov 27 20:36:40 1994
  817. --- readnews/makefile    Wed Nov  2 00:05:59 1994
  818. ***************
  819. *** 36,39 ****
  820.   r rclean:    $(ALL)
  821.   
  822.   clean:
  823. !     rm -f *.o core $(BINS)
  824. --- 36,39 ----
  825.   r rclean:    $(ALL)
  826.   
  827.   clean:
  828. !     rm -f *.o core $(BINS) .newsrc
  829.  
  830.  
  831.  
  832. *** relay/regress/regress.mastercopy    Sun Nov 27 20:36:41 1994
  833. --- relay/regress/regress    Mon Oct 24 17:03:38 1994
  834. ***************
  835. *** 14,20 ****
  836.   (cd tmp; tar -xf -) <master.tar
  837.   rm -f master.tar
  838.   cd tmp
  839. ! chmod u+w *
  840.   
  841.   echo running relaynews...
  842.   ./run
  843. --- 14,20 ----
  844.   (cd tmp; tar -xf -) <master.tar
  845.   rm -f master.tar
  846.   cd tmp
  847. ! chmod u+w * */*
  848.   
  849.   echo running relaynews...
  850.   ./run
  851.  
  852.  
  853.  
  854. *** relay/fileart.c.mastercopy    Sun Nov 27 20:36:41 1994
  855. --- relay/fileart.c    Tue Nov 15 12:54:00 1994
  856. ***************
  857. *** 252,258 ****
  858.           lp->l_dev = statb.st_dev;
  859.       free(destdir);
  860.       for (plp = link1; plp < lp; plp++)
  861. !         if (plp->l_dev == lp->l_dev && plp->l_dev != -1)
  862.               break;
  863.       if (plp < lp)            /* yes, we do */
  864.           if (plp->l_type == 'l') {
  865. --- 252,258 ----
  866.           lp->l_dev = statb.st_dev;
  867.       free(destdir);
  868.       for (plp = link1; plp < lp; plp++)
  869. !         if (plp->l_dev == lp->l_dev && plp->l_dev != (dev_t)-1)
  870.               break;
  871.       if (plp < lp)            /* yes, we do */
  872.           if (plp->l_type == 'l') {
  873.  
  874.  
  875.  
  876. *** util/newshostname.mastercopy    Sun Nov 27 20:36:42 1994
  877. --- util/newshostname    Wed Nov 23 00:00:58 1994
  878. ***************
  879. *** 4,10 ****
  880.   . ${NEWSCONFIG-/etc/news/bin/config}
  881.   
  882.   PATH=$NEWSCTL/bin:$NEWSBIN:$NEWSPATH ; export PATH
  883. - umask $NEWSUMASK
  884.   
  885.   cat $NEWSCTL/whoami
  886. - exit 0
  887. --- 4,8 ----
  888.  
  889.  
  890.  
  891. *** util/dostatfs.c.mastercopy    Sun Nov 27 20:36:42 1994
  892. --- util/dostatfs.c    Thu Nov 10 19:20:23 1994
  893. ***************
  894. *** 6,32 ****
  895.   #include <string.h>
  896.   #include <sys/types.h>
  897.   
  898. ! #include <sys/mount.h>
  899.   
  900. ! #ifndef MNAMELEN
  901. ! /* oops, this does not seem to be a 4.4BSD */
  902.   
  903. ! /* maybe it's SunOS? */
  904.   #include <sys/vfs.h>
  905. ! /* yet more silly variations... */
  906.   #ifdef _AIX
  907.   #include <sys/statfs.h>
  908.   #endif
  909. ! #endif    /* MNAMELEN */
  910.   
  911. ! #ifdef BSD4_4
  912. ! #define    f_fsize    f_bsize        /* idiotic incompatible naming in 4.4 */
  913.   #endif
  914.   
  915. - extern int debug;
  916.   
  917.   extern void error();
  918.   
  919.   /*
  920. --- 6,46 ----
  921.   #include <string.h>
  922.   #include <sys/types.h>
  923.   
  924. ! /*
  925. !  * Unfortunately, the whereabouts of the necessary struct, the exact
  926. !  * calling convention for statfs(), and the name of the "units in which
  927. !  * free space is expressed" member, are rather system-specific.  Here's
  928. !  * a few attempts...
  929. !  */
  930.   
  931. ! /* First, pick up one popular header on general principles. */
  932. ! #include <sys/mount.h>
  933.   
  934. ! /* Second, assorted variations... */
  935. ! #ifdef BSD4_4
  936. ! #define    UNIT    f_bsize
  937. ! #endif
  938. ! #ifdef sun
  939.   #include <sys/vfs.h>
  940. ! #endif
  941.   #ifdef _AIX
  942.   #include <sys/statfs.h>
  943.   #endif
  944. ! #ifdef M_XENIX        /* SCO */
  945. ! #include <sys/statfs.h>
  946. ! #define    STATFS(fs, result)    statfs(fs, &result, (int)sizeof(result), 0)
  947. ! #endif
  948.   
  949. ! /* Finally, some defaults to simplify the above. */
  950. ! #ifndef UNIT
  951. ! #define    UNIT    f_fsize
  952.   #endif
  953. + #ifndef STATFS
  954. + #define    STATFS(fs, result)    statfs(fs, &result)
  955. + #endif
  956.   
  957.   
  958. + extern int debug;
  959.   extern void error();
  960.   
  961.   /*
  962. ***************
  963. *** 45,61 ****
  964.   #    define    LOTS    10000
  965.       register long iperfile = filesize/bperi + 1;
  966.   
  967. !     if (statfs(fileonfs, &info) < 0)
  968.           error("cannot do statfs(%s)", fileonfs);
  969.       if (debug)
  970.           fprintf(stderr, "bsize %ld, avail %ld, inodes %ld\n",
  971. !                 info.f_fsize, info.f_bavail, info.f_ffree);
  972.   
  973.       n = LOTS;
  974.       if (info.f_bavail <= wantspace)
  975.           n = 0;
  976. !     else if (info.f_fsize > 0 && filesize > 0)
  977. !         n = (info.f_bavail - wantspace) / (filesize/info.f_fsize + 1);
  978.   
  979.       if (info.f_ffree < 0)        /* information unavailable */
  980.           ;            /* bypass check, and pray */
  981. --- 59,75 ----
  982.   #    define    LOTS    10000
  983.       register long iperfile = filesize/bperi + 1;
  984.   
  985. !     if (STATFS(fileonfs, info) < 0)
  986.           error("cannot do statfs(%s)", fileonfs);
  987.       if (debug)
  988.           fprintf(stderr, "bsize %ld, avail %ld, inodes %ld\n",
  989. !                 info.UNIT, info.f_bavail, info.f_ffree);
  990.   
  991.       n = LOTS;
  992.       if (info.f_bavail <= wantspace)
  993.           n = 0;
  994. !     else if (info.UNIT > 0 && filesize > 0)
  995. !         n = (info.f_bavail - wantspace) / (filesize/info.UNIT + 1);
  996.   
  997.       if (info.f_ffree < 0)        /* information unavailable */
  998.           ;            /* bypass check, and pray */
  999.  
  1000.  
  1001.  
  1002. *** util/makefile.mastercopy    Sun Nov 27 20:36:43 1994
  1003. --- util/makefile    Sun Nov 27 18:17:11 1994
  1004. ***************
  1005. *** 88,95 ****
  1006.   dospacefor:    dowhatever.o do$(SPACEFOR).o
  1007.       $(CC) $(LDFLAGS) dowhatever.o do$(SPACEFOR).o $(LIBS) -o $@
  1008.   
  1009. ! queuelen.pre:    queuelen.old
  1010. !     sed '/grade=d/s//grade=./' queuelen.old >$@
  1011.   
  1012.   queuelen.null:
  1013.       echo '#! /bin/sh' >$@
  1014. --- 88,95 ----
  1015.   dospacefor:    dowhatever.o do$(SPACEFOR).o
  1016.       $(CC) $(LDFLAGS) dowhatever.o do$(SPACEFOR).o $(LIBS) -o $@
  1017.   
  1018. ! queuelen.pre:    queuelen.vo
  1019. !     sed '/grade=d/s//grade=./' queuelen.vo >$@
  1020.   
  1021.   queuelen.null:
  1022.       echo '#! /bin/sh' >$@
  1023.  
  1024.  
  1025.  
  1026. *** util/queuelen.vo.mastercopy    Sun Nov 27 20:36:43 1994
  1027. --- util/queuelen.vo    Thu Sep 15 18:24:51 1994
  1028. ***************
  1029. *** 0 ****
  1030. --- 1,28 ----
  1031. + #! /bin/sh
  1032. + # Find size of current queue of news outbound to $1.  Ancient-uucp version.
  1033. + # =()<. ${NEWSCONFIG-@<NEWSCONFIG>@}>()=
  1034. + . ${NEWSCONFIG-/etc/news/bin/config}
  1035. + PATH=$NEWSCTL/bin:$NEWSBIN:$NEWSPATH ; export PATH
  1036. + umask $NEWSUMASK
  1037. + if test -d /usr/spool/uucp
  1038. + then
  1039. +     cd /usr/spool/uucp
  1040. + elif test -d /var/spool/uucp
  1041. + then
  1042. +     cd /var/spool/uucp
  1043. + else
  1044. +     echo "$0: can't find uucp spool directory" >&2
  1045. +     echo 9999
  1046. +     exit 1
  1047. + fi
  1048. + grade=d
  1049. + case "$1" in
  1050. + ?|??|???|????|?????|??????|???????)    site="$1" ;;
  1051. + *)    site=`expr "$1" : '^\(.......\).*'`
  1052. + esac
  1053. + ls | egrep "^C\.$site$grade....\$" | wc -l
  1054.  
  1055.  
  1056.  
  1057. *** util/dbzinfo.mastercopy    Sun Nov 27 20:36:44 1994
  1058. --- util/dbzinfo    Tue Oct 18 20:59:36 1994
  1059. ***************
  1060. *** 19,46 ****
  1061.   NR == 2 {
  1062.       print "lines", $1
  1063.       printf "lines_history"
  1064. !     n = 0
  1065. !     for (i = 2; i <= NF; i++) {
  1066. !         if (n%5 == 0 && n != 0)
  1067. !             printf "\n\t"
  1068. !         else
  1069. !             printf " "
  1070. !         printf "%d", $i
  1071. !         n++
  1072. !     }
  1073.       printf "\n"
  1074.   }
  1075.   NR == 3 {
  1076.       print "number_untagged", $1
  1077.       printf "untagged_history"
  1078. !     n = 0
  1079. !     for (i = 2; i <= NF; i++) {
  1080. !         if (n%5 == 0 && n != 0)
  1081. !             printf "\n\t"
  1082. !         else
  1083. !             printf " "
  1084. !         printf "%d", $i
  1085. !         n++
  1086. !     }
  1087.       printf "\n"
  1088.   }' $1.dir
  1089. --- 19,32 ----
  1090.   NR == 2 {
  1091.       print "lines", $1
  1092.       printf "lines_history"
  1093. !     for (i = 2; i <= NF; i++)
  1094. !         printf " %d", $i
  1095.       printf "\n"
  1096.   }
  1097.   NR == 3 {
  1098.       print "number_untagged", $1
  1099.       printf "untagged_history"
  1100. !     for (i = 2; i <= NF; i++)
  1101. !         printf " %d", $i
  1102.       printf "\n"
  1103.   }' $1.dir
  1104.  
  1105.  
  1106.  
  1107. *** util/namecheck.awk.mastercopy    Sun Nov 27 20:36:44 1994
  1108. --- util/namecheck.awk    Mon Nov  7 17:08:00 1994
  1109. ***************
  1110. *** 1,4 ****
  1111. --- 1,5 ----
  1112.   # awk program to check newsgroup names for validity, rigorously
  1113. + # echo groupname | awk -f namecheck.awk
  1114.   # It may look like some things in per-component checking could be done
  1115.   # more efficiently by moving them into whole-name checking.  The presence
  1116.   # of encoded name components messes this up.
  1117.  
  1118.  
  1119.  
  1120.